home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_whipthruwall.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  186 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shw_whipthruwall.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [CM]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.         
  14.     #    MESAGES    
  15.     message    startup        
  16.     message    touched        
  17.     message    damaged        
  18.     message    entered        
  19.         
  20.     
  21.     #    PROPS
  22.     thing        fakewall                                         linkid=1
  23.     thing        strut        
  24.     
  25.     #    CAMERAS
  26.     thing        camera                  
  27.     thing        swingcamera                  
  28.     
  29.     #    ACTORS    
  30.     thing        player                                          local                  
  31.     
  32.     #    EVENT POSITIONS
  33.     surface        dragoncue_surf                            
  34.     thing        blastpos                            
  35.     thing        wall0pos           
  36.     thing        wall1pos                   
  37.     thing        wall2pos                   
  38.     thing        fragment                                        local
  39.     thing        dustthing                                        local
  40.     
  41.     #    MATERIALS
  42.     material    dustmat=gen_a4sfx_dustcloud.mat                    local
  43.     
  44.     #    SOUND FX
  45.     sound        explosion=sol_block_crash_c.wav                    local
  46.     sound        dangercue=mus_gen_russbold_shrt1.wav            local
  47.     sound        dragon_cue=mus_shw_monkchant2.wav                local
  48.  
  49.     
  50.     #    templates
  51.     template        blast
  52.     template        wall0
  53.     template        wall1
  54.     template        wall2
  55.     template        debris
  56.     template        dust=dustcloud4ever                            local
  57.     
  58.     #    vars
  59.     int blasted=0                                               local
  60.     int    curCam                                                    local
  61.     int    camslide                                                local
  62.     int    blastcreate                                                local
  63.     int    section0                                                local
  64.     int    section1                                                local
  65.     int    section2                                                local
  66.     int    dragonplayed=0                                            local
  67.     
  68.     #    vectors
  69.     vector  vec0            
  70.     vector  vec1            
  71.     vector  vec2            
  72.     vector  forcevec        
  73.     vector  duststart                                            local        
  74.     vector  dustend                                                local        
  75.         
  76. end
  77.  
  78. # ========================================================================================
  79.  
  80. code
  81.  
  82. startup:
  83.  
  84.     player = GetLocalPlayerThing();
  85.     duststart    = VectorSet(0.2, 0.2, 0.5);
  86.     dustend    = VectorSet(1.2, 1.2, 0.0);
  87.         
  88. return;
  89.  
  90. # ========================================================================================
  91. touched:
  92.         if (blasted == 1) return;
  93.         if(GetSenderRef() == fakewall)
  94.         {
  95.                 
  96.            
  97.         PlaySoundLocal(explosion, 1, 0, 0x0, 0);
  98.         destroything(fakewall);
  99.            
  100.         # create the major wall chunks
  101.         section0=creatething(wall0, wall0pos);
  102.         section1=creatething(wall1, wall1pos);
  103.         section2=creatething(wall2, wall2pos);
  104.         
  105.         CaptureThing(wall0);
  106.         CaptureThing(wall1);
  107.         CaptureThing(wall2);
  108.  
  109.         # cut to the inside camera
  110.         SetCameraFocus(2, camera);
  111.         SetCamerasecondaryFocus(2, player);
  112.         SetCameraFOV(90, 0, 0.0);
  113.              
  114.         for(i=0; i<20; i=i+1)                                                                        
  115.              {
  116.         SetPOVShake('0.0 0.0 0.005', '0.0 0.0 0.0', 80.0, 0.80);
  117.         fragment = CreateThing(debris, blastpos);                                 
  118.         SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.1 0.0'), 1));
  119.         SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 200.0));
  120.         Sleep(0.025);
  121.              }
  122.  
  123.         #    create and animate the dust sprite
  124.         SetMaterialCel(dustmat, 0);
  125.         MaterialAnim(dustmat, 8.0, 1);
  126.         dustthing = CreateThing(dust, blastpos);
  127.         AnimateSpriteSize(dustthing, duststart, dustend, 7.0);
  128.         
  129.         
  130.         # create a blast particle system
  131.         blastcreate=CreateThing(blast, blastpos);
  132.         
  133.         # blast the debris
  134.         ApplyForce(section0, VectorScale(vec0, 2.0));
  135.         ApplyForce(section1, VectorScale(vec1, 2.0));
  136.         ApplyForce(section2, VectorScale(vec2, 2.0));
  137.         ApplyForce(player, VectorScale(forcevec, 1.0));
  138.         sleep(1.25);
  139.         
  140.         # Return control and camera to player
  141.         camslide= GetThingPos(camera);
  142.         SetCameraPosition(curcam, camslide);
  143.         SetCurrentCamera(curCam);
  144.         SetCameraFocus(curCam, player);
  145.         EndCutscene();
  146.            
  147.         }
  148.                 
  149. return;
  150. # ........................................................................................
  151. damaged:
  152.  
  153.     if ((GetSenderRef() == strut) && (GetParam(1) == 0x10))
  154.     {
  155.         # Prep...
  156.         StartCutScene(1);
  157.         curCam = GetCurrentCamera();
  158.         SetCameraPosInterp(2, 0); # kill dolly
  159.         SetCameraLookInterp(2, 0); # kill pan & tilt
  160.         
  161.         # Cut to Indy as he swings...
  162.         SetCameraFocus(2, swingcamera);
  163.         SetCameraSecondaryFocus(2, player);
  164.         SetCurrentCamera(2);
  165.         SetCameraFOV(70, 0, 0.0);
  166.         Sleep(1.0);
  167.         PlaySoundLocal(dangercue, 1.0, 0.0, 0x0, 0);
  168.     }
  169. return;
  170.  
  171. # ........................................................................................
  172. entered:
  173.  
  174.     If ((GetSenderRef() == dragoncue_surf) && (dragonplayed == 0))
  175.     {
  176.         dragonplayed = 1;
  177.         Sleep(2.0);
  178.         PlaySoundLocal(dragon_cue, 1.0, 0.0, 0x0, 0);
  179.     }
  180. return;
  181.  
  182.  
  183. # ........................................................................................
  184. end
  185.  
  186.